// by Xeno
//#define __DEBUG__
#define THIS_FILE "fn_addkilledehsm.sqf"
#include "x_setup.sqf"
__TRACE_1("","_this");

_this addEventHandler ["killed", {
	__TRACE_1("killed eh","_this");
#ifdef __TT__
	GVAR(sm_winner) = (switch (side (group (_this select 1))) do {case opfor:{1};case blufor:{2};default{-1};});
#else
	GVAR(sm_winner) = 2;
#endif
	GVAR(sm_resolved) = true;
	if (GVAR(IS_HC_CLIENT)) then {
		[QGVAR(sm_var), GVAR(sm_winner)] call FUNC(NetCallEventCTS);
	};
}];
_this addEventHandler ["handleDamage", {_this call FUNC(CheckSMShotHD)}];
GVAR(x_sm_vec_rem_ar) set [count GVAR(x_sm_vec_rem_ar), _this];